<extend name="Common:sysTemplate" />
<block name="content">
<form action="" method="post" onsubmit="return pageAjaxSubmit();">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table1">
        <tr>
            <th width="120">用户名</th>
            <td><input <if condition="ACTION_NAME eq 'editAdmin'"> disabled="disabled"</if> name="username" type="text" class="input" size="40" value="{$info.username}" /></td>
        </tr>
        <tr>
            <th>密码：</th>
            <td>
                <input class="input" name="pwd" type="text" size="40" value="" />
                <if condition="ACTION_NAME eq 'editAdmin'">不修改请留空</if>
            </td>
        </tr>
        <tr>
        <tr>
            <th width="120">真实姓名</th>
            <td><input name="nickname" type="text" class="input" size="40" value="{$info.nickname}" /></td>
        </tr>
        <tr>
            <th>所属部门</th>
            <td><select name="deptid" style="min-width: 80px;">
                <option value="" >请选择</option>
                {$info.deptOption}</select></td>
        </tr>
        <tr>
            <th width="120">Email</th>
            <td><input name="email" type="text" class="input" size="40" value="{$info.email}" /></td>
        </tr>
        <tr>
            <th>状态：</th>
            <td>
                <select name="status" style="width: 80px;">
                    <if condition="$info.status eq 1">
                        <option value="1" selected>启用</option>
                        <option value="0">禁用</option>
                        <else/>
                        <option value="1">启用</option>
                        <option value="0" selected>禁用</option>
                    </if>
                </select>
                如果禁用了将无法登陆本系统</td>
        </tr>
        <tr>
            <th>所属用户组</th>
            <td><select name="role_id" style="min-width: 80px;">
                <option value="">请选择</option>
                {$info.roleOption}</select></td>
        </tr>
        <tr>
            <th>备注：</th>
            <td><textarea name="remark" rows="5" cols="57">{$info.remark}</textarea></td>
        </tr>
    </table>
    <input type="hidden" name="id" value="{$info.id}"/>
    <div class="commonBtnArea">
        <input type="submit" value="提交" />
    </div>
</form>
</block>
<block name="footjs">          
<script type="text/javascript">
    $("input[name='username']").focus();
    var pageAjaxSubmit = function(){

        <if condition="ACTION_NAME neq 'editAdmin'">
        if($.trim($("input[name='username']").val())==''){
            $.jBox.tip("用户名不能为空",'error');
            $("input[name='username']").focus();
            return false;
        }
        if($.trim($("input[name='pwd']").val())==''){
            $.jBox.tip("密码不能为空",'error');
            $("input[name='pwd']").focus();
            return false;
        }
        </if>
        var nickname = $("input[name='nickname']").val();
        if(nickname==''){
            $.jBox.tip("真实姓名不能为空",'error');
            $("input[name='nickname']").focus();
            return false;
        }
        var email = $("input[name='email']").val();
        if(email!=''&&!isEmail(email)){
            $.jBox.tip("邮件地址格式错误",'error');
            $("input[name='email']").focus();
            return false;
        }
        var role_id = $("select[name='role_id']").val();
        if(role_id==''){
            $.jBox.tip("请选择用户组",'error');
            $("select[name='role_id']").focus();
            return false;
        }
        return commonAjaxSubmit();
    };
</script>
</block>
